package org.seckill.access;

import lombok.extern.slf4j.Slf4j;
import org.seckill.bean.User;

@Slf4j
public class UserContext {
    private static ThreadLocal<User> userHolder = new ThreadLocal<>();

    public static void setUser(User user){
        userHolder.set(user);
    }

    public static User getUser(){
//        log.error("UserContext: " + userHolder.toString() +" user: " + userHolder.get());
        return userHolder.get();
    }
}
